<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('vip消费列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
<!--                        <ul>-->
<!--                            <li>-->
<!--                                <label>会员号：</label>-->
<!--                                <input type="text" name="vipId"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>余额：</label>-->
<!--                                <input type="text" name="balance"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>对应系统用户的主键：</label>-->
<!--                                <input type="text" name="userId"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>-->
<!--                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>-->
<!--                            </li>-->
<!--                        </ul>-->
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                 <a class="btn btn-success" onClick="charge()" >
                    <i class="fa fa-plus"></i> 充值
                </a>
                <div>
                    当前余额：<span id="currentBalance" style="color: red;font-weight: bold">invalid</span>
                </div>
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:vip:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:vip:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:vip:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/vip";

        document.querySelector("#currentBalance").innerHTML = '[[${currentBalance}]]';

        function charge(){
            $.modal.open('VIP充值',prefix + '/chargevip');
        }

        $(function() {
            var options = {
                url: prefix + "/purchaselist",
                modalName: "vip消费记录",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'vipId',
                    title: '会员号',
                  
                },
                {
                    field: 'userName',
                    title: '用户名',
                  
                },
                {
                    field: 'barCode',
                    title: '商品条码'
                },
                {
                    field: 'name',
                    title: '商品名'
                },
                {
                    field: 'quantity',
                    title: '数目'
                    
                },
                {
                    field: 'date',
                    title: '消费时间'

                }
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>